package com.hoyo.domain;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Email;

/**
 * <p>Title:用户基本信息实体类</p>
 * <p>Description:用于接收用户对个人信息的修改数据、和展示个人信息</p>
 * @version 1.0
 * @author 龚文伟
 * @date 2017年05月03日
 */
public class User implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**		ID of user		**/
	private int id;
	
	/**	 	password of user		**/
	private String password;
	
	/**		email of user		**/
	private String email;
	
	/**		telephone of user		**/
	private String phone;
	
	private Timestamp registerTime;
	
	private boolean isLocked;
	
	public User() {
	}

	public int getId() {
		return id;
	}

	public void setId(int iD) {
		id = iD;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
//		if(email == null){
//			return ;
//		}
//		int index = email.lastIndexOf("@");
//		StringBuilder builder = new StringBuilder();
//		for(int i=3; i<index;i++){
//			builder.append("*");
//		}
//		this.email = email.substring(0, 3)+builder.toString()+phone.substring(index+1);
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String telephone) {
		this.phone = telephone;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
	
	public Timestamp getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(Timestamp registerTime) {
		this.registerTime = registerTime;
	}

	public boolean getIsLocked() {
		return isLocked;
	}

	public void setIsLocked(boolean isLocked) {
		this.isLocked = isLocked;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", password=" + password + ", email=" + email + ", phone=" + phone + ", registerTime="
				+ registerTime + ", isLocked=" + isLocked + "]";
	}
}
